<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('事项列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>事项名称：</p>
                                <input type="text" name="name"/>
                            </li>

                            <!--<li>-->
                                <!--<input type="hidden" name="light"  th:value="${tab}"/>-->
                            <!--</li>-->

                            <li>
                                <p>警报类型：</p>
                                <select name="light" >
                                    <option value="">所有</option>
                                    <!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
                                    <option value="1" th:selected="${tab == '1'}">红色警告</option>
                                    <option value="2" th:selected="${tab == '2'}">黄色警告</option>
                                </select>
                            </li>
                            <li>
                                <p>负责单位：</p>
                                <input type="text" name="mainOrgname"/>
                            </li>
                            <li>
                                <p>审批人：</p>
                                <input type="text" name="approveUsername"/>
                            </li>

                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="closeItem()">
                    <i class="fa fa-reply-all"></i> 关闭
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "linkong/matterProject";

        $(function() {
            var options = {
                url: prefix + "/list",
                modalName: "事项",
                columns: [{
                    checkbox: false,
                    visible: false
                },
                {
                    field : 'light',
                    title : '当前亮灯',
                    formatter:function(value){
                        if(value == '1'){
                            return'<img  class="imgtag" src="../../img/light_02.png" alt="">'
                        }else if(value == '2'){
                            return'<img  class="imgtag" src="../../img/light_03.png" alt="">'
                        }
                    }
                },
                {
                    field : 'name', 
                    title : '事项名称'
                },
                    {
                        field : 'proName',
                        title : '项目名称'
                    },
                {
                    field : 'mainOrgname',
                    title : '负责单位'
                },


                {
                    field : 'approveUsername',
                    title : '审批人'
                },

                {
                    field : 'matterContent',
                    title : '事项内容'
                },
                {
                    field : 'expectedDate', 
                    title : '预计完成时间',
                    formatter:function(value){
                        return value==null?"":value.substr(0,10)
                    }
                },

               ]
            };
            $.table.init(options);
        });

    </script>
</body>
</html>